package com.lbn.monitor.api;

import com.free.framework.business.BaseModel;
import com.lbn.monitor.api.model.AlarmDevice;
import com.lbn.monitor.api.model.CheckUpdate;
import com.lbn.monitor.api.model.Device;
import com.lbn.monitor.api.model.Pollutant;
import com.lbn.monitor.api.model.RealTimeValue;
import com.lbn.monitor.api.model.User;
import com.lbn.monitor.api.model.XiShu;


import java.util.List;
import java.util.Map;

import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by 李炳南
 * 2017/3/7.
 */

public interface ApiService {

    @GET("index.php/device/configs/{page}/10")
    Observable<BaseModel<List<Device>>> deviceList(@Path("page") int page);

    @GET("index.php/AlarmInfo/alarms/{page}/10")
    Observable<BaseModel<List<AlarmDevice>>> warningList(@Path("page") int page);

    @GET("index.php/CollectedData/device/{mn}")
    Observable<BaseModel<List<RealTimeValue>>> realTimeValue(@Path("mn") String mn);

    @FormUrlEncoded
    @POST("index.php/CollectedData/history")
    Observable<BaseModel<List<RealTimeValue>>> history(@Field("dmn")String mn,@Field("data_cn")String dataCn,@Field("start_time")String start_time,@Field("end_time")String end_time,@Field("page")int page,@Field("count")String count);

    @GET("index.php/pollutants")
    Observable<BaseModel<List<Pollutant>>> pollutants();

    @FormUrlEncoded
    @POST("index.php/user/token")
    Observable<BaseModel<List<User>>> login(@Field("username")String username,@Field("password")String password);

    @FormUrlEncoded
    @POST("index.php/user/pwd")
    Observable<BaseModel<Object>> pwd(@Field("user_id")String id,@Field("pre_pwd")String prePwd,@Field("new_pwd")String newPwd);

    @GET("index.php/LiuLiangXiShu")
    Observable<BaseModel<List<XiShu>>> liuLiangXiShu(@Query("device_id") String deviceId);

    @GET("index.php/AppInfo/version")
    Observable<BaseModel<List<CheckUpdate>>> checkUpdate();

//    @GET("index.php/pollutants")
//    Observable<BaseModel<List<Pollutant>>> pollutants();
}
